#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/4/8 0008 21:15
# @Author : Moyan# @Site : 
# @File : Chap1.py
# @Software: PyCharm

#整数的计算加减乘除，浮点数的加减乘除

print(1+2)
print(1-2)
print(1*2)
print(1/2)

print("-------------------")
print(0.1+0.2)
print(0.1 - 0.2)
print(0.1*0.2)
print(0.1/0.2)

print("--------列表及元组，切片操作-----------")

list = ["a","b","c"]
print(list[:2])

tup = ("1","2",["a","b","c"])

print(tup[0:2])

print("倒叙输出")
print(list[::-1])

print("---------列表及元组，拼接操作----------")
print(list+list)
print(tup+tup)

print("---------列表及元组添加内容----------")
list.append("----")
print(list)

print("---------字典操作----------")

direct = {"a":"b","c":"d",'t':1,'f':list}
print(direct.get("a"))
print(direct["a"])
print(direct.get("e","默认值"))
print(direct.get('f'))